﻿<%@ Page Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<YourStore.ViewModels.StoreBrowseViewModel>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
    Browse Products
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
<div id="right">
    
        <h2><%: Model.Category.Name %></h2>


         <div class="products">
      <div></div>
      <ul>

       <% foreach (var product in Model.Products)
    {
                %>
            <li>           
                <a href="<%: Url.Action("Details", new { id = product.ProductId }) %>"> 
                 <div class="product-pic">
                    <img alt="<%: product.Name %>" src='/Content/Uploads/<%: product.Image %>'  height="142" alt="<%: product.Name %>"  /></div>
                 </a>
                 <div class="p-name"><%: product.Name%><span class="price">Price: $ <%: String.Format("{0:F}", product.Price) %></span></div>
                    
              
            
           <div class="details">
          <a href="<%= Url.Action("Details","Store", new { id = product.ProductId})%>">
          <img  src="/Content/Images/view-details.jpg"  width="105" alt="View Details" height="30"/></a>
          </div>


          <div class="add-cart">
          <a href="<%= Url.Action("AddToCart","ShoppingCart", new { id = product.ProductId})%>" class="btn_addcart">
              <img src="/Content/Images/add-cart.jpg" width="105" height="30" alt="Add to Cart" />
          </a>
          </div>
          <//li>
         
                   
   <% } %>
           



     
</div>

</div>











<%--table id="product-list">
<%int i=0; %>
 <% foreach (var product in Model.Products)
    {
                %>
               <%if (i == 0|| (i>2 && i%3==0))
                 {%>
               <tr>
               <%} %>    
               <td>                    
                <a href="<%: Url.Action("Details", new { id = product.ProductId }) %>">  </a>
                    <img alt="<%: product.Name %>" src='/Content/Uploads/<%: product.Image %>' width="188px" height="200px" />
                    
              
                 <span><%: product.Name%></span><br/>
                <span> Price:<%: product.Price%></span><br/>
            
             <a href="<%= Url.Action("Details","Store", new { id = product.ProductId})%>" class="btn_viewdetails"></a>
           <a href="<%= Url.Action("AddToCart","ShoppingCart", new { id = product.ProductId})%>" class="btn_addcart"></a>
          </td>
          <%i++; %>
          <%if (i > 2 && i % 3 == 0)
            {%>
               </tr>
               <%} %>
               <%
                   
    } %>
           

</table>--%>
<%--<ul id="product-list">
            </ul>



      <ul id="product-list">
            <% foreach (var product in Model.Products)
               { %>

            <li>
                <a href="<%: Url.Action("Details", new { id = product.ProductId }) %>">  </a>
                    <img alt="<%: product.Name %>" src="../../Content/Images/Computer.jpg" />
                    
              
                 <span><%: product.Name%></span><br/>
            <span> Price:<%: product.Price %></span><br/>
            
             <a href="<%= Url.Action("Details","Store", new { id = product.ProductId})%>" class="btn_viewdetails"></a>
           <a href="<%= Url.Action("AddToCart","ShoppingCart", new { id = product.ProductId})%>" class="btn_addcart"></a>
            </li>

            <% } %>
        </ul>--%>


        <%-- <ul id="product-list">
       <% foreach (var product in Model.Products)
           { %>
        <li>
            <a href="<%: Url.Action("Details", "Store", new { id = product.ProductId }) %>">
            <img alt="<%: product.Name %>" src="../../Content/Images/Computer.jpg" />
            </a>
            <span><%: product.Name%></span><br/>
            <span> Price:<%: product.Price %></span><br/>
            
             <a href="<%= Url.Action("Details","Store", new { id = product.ProductId})%>" class="btn_viewdetails"></a>
           <a href="<%= Url.Action("AddToCart","ShoppingCart", new { id = product.ProductId})%>" class="btn_addcart"></a>
        </li>
        <% } %>
    </ul>--%>

   

</asp:Content>
